#!/bin/bash

#PBS -l nodes=1:ppn=8,walltime=2:00:00,mem=10GB
#PBS -N population_vcf
#PBS -M cmb433@nyu.edu
#PBS -m abe
#PBS -e localhost:/scratch/cmb433/primate_RAD/${PBS_JOBNAME}.e${PBS_JOBID}
#PBS -o localhost:/scratch/cmb433/primate_RAD/${PBS_JOBNAME}.o${PBS_JOBID}

# ------------------------------------------------------------------------------
# Variables
# ------------------------------------------------------------------------------

export OMP_NUM_THREADS=8

working_dir=/scratch/cmb433/primate_RAD

# ------------------------------------------------------------------------------
# Run stacks populations
# ------------------------------------------------------------------------------

cd $working_dir

echo "Starting stacks";

#STACKS=/home/cmb433/exome_macaque/bin/stacks-0.9999/build/bin

module load stacks/intel/0.9999;

# Output to vcf format
populations -P all_primate/stacks/ -M stacks_pop_assign.txt -b 1 -p 2 -t 8 --vcf

echo "Finished stacks";

exit;
